from datetime import *
a = input("Enter Lower Bound ")
b = input("Enter Upper Bound ")
if a == 1 or a == 0 :
    a = 2
c = None
d = 0
e = []
st = datetime.now()
for i in range(a,b+1) :
    d += 1
    c = 0
    if d < 5 :
        for j in range (2,i+1):
            if i%j == 0 :
                c += 1
        if c == 1 :
            print i 
            e.append(i)
    if d >= 5 :
        for h in range(0,len(e)) :
            k = e[h]
            if i%k == 0 :
                c += 1
        if c == 0 :
           print i 
           e.append(i)
print e
com = datetime.now()
mi = int(com.minute) - int(st.minute)
m1 = int(st.microsecond)/1000000.0
m2 = int(com.microsecond)/1000000.0
s1 = mi*60
s2 = s1 + ((int(com.second)+m2) - (int(st.second)+m1)) 
print "The operation took",s2,"seconds."
